﻿@model HomeCareLibrary.Models.HomeCareLibraryCategoryModel

@{

    //Session[HomeCareLibrary.Constants.SessionConstants.PROMO_CODE] = 123;

    ViewBag.Title = "Home care library";
}
<div class="col-lg-9 col-sm-9 right_part">
    
     @*Header not show in case of Android App. *@
             @if (Session[HomeCareLibrary.Constants.SessionConstants.MODE] == null || Session[HomeCareLibrary.Constants.SessionConstants.MODE] == HomeCareLibrary.Constants.ApplicationModeConstants.IPHONE_APP || Session[HomeCareLibrary.Constants.SessionConstants.MODE] == HomeCareLibrary.Constants.ApplicationModeConstants.IPAD_APP)
               {
    <div class="title clearfix">
         <div id="back-button" class="back-button"><a href="javascript:void(0);"><img class="back-btn" alt="back-btn" src="@Url.Content("~/images/personalization-images/back-btn.png")"> 
                       
                        <div class="back-mob-btn"><span class="glyphicon glyphicon-chevron-left"></span> Back</div>
                        </a></div>
        <h1>Home Care Library</h1>
    </div>
             }
     <input type="hidden" value="@Session[HomeCareLibrary.Constants.SessionConstants.MODE]" id="hdnSessionValue" />
    <div class="main-content">
        <div class="hcl-tab-page">
            <div class="hcl-tab-page-bg">
                <div class="hcl-tab">
                    <div class="hcl-tab-head">
                        <img src="@Url.Content("~/images/hcl-head.png")" alt="hcl-head">
                    </div>
                    <div id="accordion" class="panel-group">
                        
                        @foreach (var Mainitem in Model.listPortfolio)
                        {
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    <h4 class="panel-title">
                                        <a href="#@Mainitem.HomeCare_Category.Substring(0, 4)" data-parent="#accordion" data-toggle="collapse" class="accordion-toggle collapsed">
                                            @Mainitem.HomeCare_Category Care
                                        </a>
                                    </h4>
                                </div>
                                <div class="panel-collapse collapse" id="@Mainitem.HomeCare_Category.Substring(0, 4)" style="height: 0px;">
                                    <div class="panel-body nopadding data-inner">
                                        @foreach (var item in Model.listPortfolioTags)
                                        {
                                            if (Mainitem.ID == item.CategoryID)
                                            {
                                            <div class="panel-group" id="accordion-inn-Heating">
                                                <div class="panel panel-default">
                                                    <div class="panel-heading">
                                                        <h4 class="panel-title">
                                                            <a class="accordion-toggle collapsed"  href='@Url.Action("overview", "Home", new { ID = item.Feature_Name.Trim().Replace(" ", "-").ToLower() })'>
                                                                @item.Feature_Name
                                                            </a>
                                                        </h4>
                                                    </div>
                                                    <div style="height: auto;" id="@(Mainitem.HomeCare_Category.Substring(0, 4) + item.Feature_code)" class="panel-collapse collapse">
                                                        <div class="panel-body">
                                                            @item.Feature_description  <span class="media-more"><a class="ui-link"  href="@Url.Action("overview", "Home", new { ID = item.Feature_Name.Trim().Replace(" ", "-").ToLower() })">more<small> &#9654;</small></a></span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            }
                                        }
                                    </div>
                                </div>
                            </div>
                        }
                    </div>
                </div>

                  <br /> <br />

                       <span style="margin-left:10px;">
                   JSON:
                    @if (ViewBag.JsonString != string.Empty)
                   {
                      @ViewBag.JsonString
                   }</span>

                         <br /><br />
                         <span style="margin-left:10px;">
                  Request Content-Type:
                    @if (ViewBag.ContentType != string.Empty)
                   {
                      @ViewBag.ContentType
                   }
                      </span>

                      <br /><br />
                         <span style="margin-left:10px;">
                  Request URL:
                    @if (ViewBag.Url != string.Empty)
                   {
                      @ViewBag.Url
                   }
                      </span>

                      <br><br><br><br><br><br><br>
            </div>
        </div>
    </div>
</div>
<script>
        $(function () {
            if ($("#hdnSessionValue").val() == "@HomeCareLibrary.Constants.ApplicationModeConstants.IPHONE_APP") {
                 $(".mobileMenu").hide();
             }
         });


    $("#back-button").live("click", function () {

        checkscreenWidth();
        if ($("#hdnSessionValue").val() == "iphoneApp") {
            $(".mobileMenu").show();
        }
        $("#divtopHomecarelibrary").hide();
        $("#divbottomtaskstips").show();
        $(".task-tab, .tips-tab, .ideas-tab, .admin-tab").hide();
        $(".extras-tab").show();
       
    });

    function checkscreenWidth() {

        var $window = $(window);
        var windowsize = $window.width();
       
        if (windowsize < 767) {
            $(".mobileMenu").show();
        }
        else {
            $(".mobileMenu").hide();
        }

    }

    </script>